﻿//===================================================================
// 西交通开发框架-XCI.Parent 2019 版权所有     
//===================================================================
using System.ComponentModel.DataAnnotations;
using XCI.Core;

namespace XCI.Sys.Model
{
    /// <summary>
    /// 系统角色
    /// </summary>
    [ApiModel(Caption = "系统角色")]
    public class SysRole
    {
        /// <summary>
        /// 角色主键
        /// </summary>
        [Display(Name = "角色主键")]
        [ApiModelProperty(PrimaryKey = true)]
        public string Id { get; set; }

        /// <summary>
        /// 角色名称
        /// </summary>
        [Display(Name = "角色名称")]
        [Required(ErrorMessage = "请输入角色名称")]
        [StringLength(100, ErrorMessage = "角色名称不能超过100个字符")]
        public string Name { get; set; }

        /// <summary>
        /// 角色编码
        /// </summary>
        [Display(Name = "角色编码")]
        [Required(ErrorMessage = "请输入角色编码")]
        [StringLength(100, ErrorMessage = "角色编码不能超过100个字符")]
        public string Code { get; set; }

        /// <summary>
        /// 角色简拼
        /// </summary>
        [Display(Name = "角色简拼")]
        [StringLength(100, ErrorMessage = "角色简拼不能超过100个字符")]
        public string Spell { get; set; }

        /// <summary>
        /// 机构主键
        /// </summary>
        [Display(Name = "机构主键")]
        [Required(ErrorMessage = "请选择机构")]
        public string DeptId { get; set; }

        /// <summary>
        /// 机构名称
        /// </summary>
        [Display(Name = "机构名称")]
        public string DeptName { get; set; }

        /// <summary>
        /// 机构数据权限 [1-全部, 2-自定义, 3-所在部门及所有下级, 4-所在部门, 5-仅本人]
        /// </summary>
        [Display(Name = "机构数据权限")]
        public int DeptScope { get; set; }

        /// <summary>
        /// 机构数据权限名称
        /// </summary>
        [Display(Name = "机构数据权限名称")]
        public string DeptScopeName { get; set; }

        /// <summary>
        /// 序号
        /// </summary>
        [Required(ErrorMessage = "请输入序号")]
        [Display(Name = "序号")]
        public int Path { get; set; }

        /// <summary>
        /// 状态[true-启用, false-禁用]
        /// </summary>
        [Display(Name = "状态")]
        public bool Status { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        [Display(Name = "备注")]
        [StringLength(500, ErrorMessage = "备注不能超过500个字符")]
        public string Remark { get; set; }

        /// <summary>
        /// 复制对象
        /// </summary>
        public SysRole Clone()
        {
            return (SysRole)MemberwiseClone();
        }
    }
}
